from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter, A4
from reportlab.lib.units import inch, cm


#precalculate some basics
top_margin = A4[1] - inch
bottom_margin = inch
left_margin = inch
right_margin = A4[0] - inch
frame_width = right_margin - left_margin


def users(c):
    c.drawString(left_margin, top_margin,"Hello World")
    c.drawString(left_margin, top_margin,"Hello World")
    c.line(left_margin, top_margin, right_margin, top_margin)



# create the canvas object    
c = canvas.Canvas("userreport.pdf", pagesize=A4)

# get dimensions of pagesize
width, height = letter

# call the users function to create page
users(c)

# print page 
c.showPage()

# save the page(s) to the file
c.save()
